{  Statement: http://acmp.ru/?main=task&id_task=13
   Verdict: Accepted
}
uses
    SysUtils, Math;

var
    i,b,c,kk:longint;
    s,t:string;

begin
reset(input,'input.txt');
rewrite(output,'output.txt');
readln(t);
s:=copy(t,1,4);
delete(t,1,5);
b := 0;
c := 0;
for i:=1 to 4 do begin
    kk := pos(t[i],s);
    if kk > 0 then 
        if kk = i then inc(b) else inc(c);
end;
write(b,' ',c);
end.